package com.hu.system.domain;

import java.math.BigDecimal;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hu.common.annotation.Excel;
import com.hu.common.core.domain.BaseEntity;

/**
 * 产品分析对象 product_analysis
 *
 * @author hu
 * @date 2025-01-22
 */
public class ProductAnalysis extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * SKU编码
     */
    @Excel(name = "SKU编码")
    private String sku;

    /**
     * 产品名称
     */
    @Excel(name = "产品名称")
    private String productName;

    /**
     * SKU属性
     */
    @Excel(name = "SKU属性")
    private String skuAttr;

    /**
     * SKU货号（非数据库字段，从product_info关联查询）
     */
    @Excel(name = "SKU货号")
    private String skuCode;

    /**
     * 所属店铺ID
     */
    private Long shopId;

    /**
     * 所属店铺名称
     */
    @Excel(name = "所属店铺")
    private String shopName;

    /**
     * 核价（从产品表获取）
     */
    @Excel(name = "核价")
    private BigDecimal priceCheck;

    /**
     * 备货总数量（从备货出库表统计，内部计算用）
     */
    private Integer totalStockQuantity;

    /**
     * 总销售数量（内部计算用）
     */
    private Integer totalSalesQuantity;

    /**
     * 总收入金额（内部计算用）
     */
    private BigDecimal totalIncomeAmount;

    /**
     * 总售后金额（内部计算用）
     */
    private BigDecimal totalAftersaleAmount;

    /**
     * 产品单个平均成本
     * 公式：{（产品单价×总计备货数量）＋SKU的总计物流费用＋售后金额}÷总计备货数量
     */
    @Excel(name = "产品单个平均成本")
    private BigDecimal productAvgCost;

    /**
     * 单个平均收入金额
     * 公式：总收入金额÷销售总数量
     */
    @Excel(name = "单个平均收入金额")
    private BigDecimal avgIncomeAmount;

    /**
     * 利润
     * 公式：单个平均收入金额 - 产品单个平均成本
     */
    @Excel(name = "利润")
    private BigDecimal profit;

    /**
     * 利润率(%)
     * 公式：利润÷单个平均收入金额×100%
     */
    @Excel(name = "利润率(%)")
    private BigDecimal profitRate;

    /**
     * 售后率(%)
     * 公式：售后总金额÷收入金额×100%
     */
    @Excel(name = "售后率(%)")
    private BigDecimal aftersaleRate;

    /**
     * 产品单价（从采购表获取平均值，内部计算用）
     */
    private BigDecimal unitPrice;

    /**
     * 物流费用（从备货出库表统计，内部计算用）
     */
    private BigDecimal logisticsFee;

    /** 售后率筛选范围（查询参数）：very_low=5%以下, low=5%-10%, medium=10%-20%, high=20%-30%, very_high=30%以上 */
    private String aftersaleRateRange;

    /** 利润率筛选范围（查询参数）：low=30%以下, medium=30%-50%, high=50%以上 */
    private String profitRateRange;

    public void setSku(String sku) {
        this.sku = sku;
    }

    public String getSku() {
        return sku;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductName() {
        return productName;
    }

    public void setSkuAttr(String skuAttr) {
        this.skuAttr = skuAttr;
    }

    public String getSkuAttr() {
        return skuAttr;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopName() {
        return shopName;
    }

    public void setPriceCheck(BigDecimal priceCheck) {
        this.priceCheck = priceCheck;
    }

    public BigDecimal getPriceCheck() {
        return priceCheck;
    }

    public void setTotalStockQuantity(Integer totalStockQuantity) {
        this.totalStockQuantity = totalStockQuantity;
    }

    public Integer getTotalStockQuantity() {
        return totalStockQuantity;
    }

    public void setTotalSalesQuantity(Integer totalSalesQuantity) {
        this.totalSalesQuantity = totalSalesQuantity;
    }

    public Integer getTotalSalesQuantity() {
        return totalSalesQuantity;
    }

    public void setTotalIncomeAmount(BigDecimal totalIncomeAmount) {
        this.totalIncomeAmount = totalIncomeAmount;
    }

    public BigDecimal getTotalIncomeAmount() {
        return totalIncomeAmount;
    }

    public void setTotalAftersaleAmount(BigDecimal totalAftersaleAmount) {
        this.totalAftersaleAmount = totalAftersaleAmount;
    }

    public BigDecimal getTotalAftersaleAmount() {
        return totalAftersaleAmount;
    }

    public void setProductAvgCost(BigDecimal productAvgCost) {
        this.productAvgCost = productAvgCost;
    }

    public BigDecimal getProductAvgCost() {
        return productAvgCost;
    }

    public void setAvgIncomeAmount(BigDecimal avgIncomeAmount) {
        this.avgIncomeAmount = avgIncomeAmount;
    }

    public BigDecimal getAvgIncomeAmount() {
        return avgIncomeAmount;
    }

    public void setProfit(BigDecimal profit) {
        this.profit = profit;
    }

    public BigDecimal getProfit() {
        return profit;
    }

    public void setProfitRate(BigDecimal profitRate) {
        this.profitRate = profitRate;
    }

    public BigDecimal getProfitRate() {
        return profitRate;
    }

    public void setAftersaleRate(BigDecimal aftersaleRate) {
        this.aftersaleRate = aftersaleRate;
    }

    public BigDecimal getAftersaleRate() {
        return aftersaleRate;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setLogisticsFee(BigDecimal logisticsFee) {
        this.logisticsFee = logisticsFee;
    }

    public BigDecimal getLogisticsFee() {
        return logisticsFee;
    }

    public String getAftersaleRateRange() {
        return aftersaleRateRange;
    }

    public void setAftersaleRateRange(String aftersaleRateRange) {
        this.aftersaleRateRange = aftersaleRateRange;
    }

    public String getProfitRateRange() {
        return profitRateRange;
    }

    public void setProfitRateRange(String profitRateRange) {
        this.profitRateRange = profitRateRange;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("sku", getSku())
                .append("productName", getProductName())
                .append("skuAttr", getSkuAttr())
                .append("skuCode", getSkuCode())
                .append("shopId", getShopId())
                .append("shopName", getShopName())
                .append("priceCheck", getPriceCheck())
                .append("totalStockQuantity", getTotalStockQuantity())
                .append("totalSalesQuantity", getTotalSalesQuantity())
                .append("totalIncomeAmount", getTotalIncomeAmount())
                .append("totalAftersaleAmount", getTotalAftersaleAmount())
                .append("productAvgCost", getProductAvgCost())
                .append("avgIncomeAmount", getAvgIncomeAmount())
                .append("profit", getProfit())
                .append("profitRate", getProfitRate())
                .append("aftersaleRate", getAftersaleRate())
                .append("unitPrice", getUnitPrice())
                .append("logisticsFee", getLogisticsFee())
                .toString();
    }
}

